
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>头盔检测系统-登录</title>
    <link rel="stylesheet" type="text/css" href="EasyUI/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="EasyUI/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="EasyUI/themes/color.css">
    <link rel="stylesheet" type="text/css" href="EasyUI/demo.css">
    <script type="text/javascript" src="EasyUI/jquery.min.js"></script>
    <script type="text/javascript" src="EasyUI/jquery.easyui.min.js"></script>
</head>
<body class="easyui-layout">
<div data-options="region:'center',border:false" style="text-align: center; padding-top: 120px;
 background: radial-gradient(ellipse at center, skyblue, #00bbee)">
    <h1>欢迎使用头盔检测系统</h1>
    <img src="/images/cover.jpg" alt="示例图片" style="padding-top: 40px;">
</div>
<div data-options="region:'east',split:true,width:300" style="padding: 50px;">
    <form id="loginForm">
        <div>
            <label for="userId">用户ID：</label>
            <input id="userId" name="id" class="easyui-textbox" data-options="required:true">
        </div>
        <div>
            <label for="password">密码：</label>
            <input id="password" name="password" type="password" class="easyui-passwordbox" data-options="required:true">
        </div>
        <div style="text-align: right; margin-top: 20px;">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitLogin()">登录</a>
        </div>
    </form>
</div>
</body>
<script type="text/javascript">
    function submitLogin() {
        $("#loginForm").form("submit", {
            // 向控制器类userController中login方法发送请求
            url : 'user/login',
            success : function(result) {
                var result = JSON.parse( result );
                if (result.success == 'true') {//登陆成功
                    //跳转到主页面
                    window.location.href = 'home.html';
                    $("#adminLoginDlg").dialog("close");
                } else {
                    $.messager.show({
                        title : "提示信息",
                        msg : result.message
                    });
                }
            }
        });
    }
</script>
</html>